package com.git.hui.yinshua.api.model.constants;

import com.github.hui.quick.plugin.base.constants.MediaType;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/**
 * @author YiHui
 * @date 2024/6/13
 */
public interface GlobalConstants {
    int MAX_QUERY_SIZE = 1000;

    // 在线，下线的状态
    int ONLINE_STATE = 1;
    int OFFLINE_STATE = 0;

    // 已删除标记
    int DELETED_TAG = 1;
    int NOT_DELETED_TAG = 0;


    interface AttrApi {
        // 适用所有分类的属性
        Integer APPLY_FOR_ALL_CID_KEYS = 0;

    }

    interface GoodsApi {
        // 商品上下架
        Integer GOODS_ONLINE_STATE = 1;
        Integer GOODS_OFFLINE_STATE = 0;


        Integer GOODS_RECOMMEND_STATE = 1;
        Integer GOODS_UNRECOMMEND_STATE = 0;


        // 无限库存
        Integer NO_LIMIT_STOCK = -1;


        // 开启拼团
        Integer PT_ENABLE = 1;
        Integer PT_DISABLE = 0;
    }

    interface AddressApi {
        // 默认地址
        Integer MAIN_ADDRESS = 1;
        // 普通地址
        Integer NORMAL_ADDRESS = 0;
    }

    interface ImgApi {
        public static final Long EXPIRE_IN_SECONDS = 7200L;
        String DEFAULT_FILE_TYPE = "txt";
        Set<MediaType> STATIC_IMG_TYPE = new HashSet<>(Arrays.asList(MediaType.ImagePng, MediaType.ImageJpg, MediaType.ImageWebp, MediaType.ImageGif));
    }

    interface OrderApi {
        /**
         * 支付倒计时，默认45分钟
         */
        Long PAY_INTERVAL_TIME = 45 * 60_000L;
    }

    interface PayApi {
        Long PRE_PAY_CHECK_EXPIRE_TIME_INTERVAL = 600l;

        Long PRE_PAY_EXPIRE_TIME_PERIOD = 5400_000L;
    }
}
